﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:behavior="clr-namespace:MicroBlogClient.Behaviors"
            xmlns:controls="clr-namespace:Rabbit.Controls;assembly=Rabbit.Controls"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <DataTemplate x:Key="UserItemsTemplate">
        <DockPanel Margin="0,10,0,10" x:Name="grid" Background="White">
            <!--User Picture-->
            <Border VerticalAlignment="Top" Width="40" >
                <Border BorderBrush="White" DockPanel.Dock="Left" CornerRadius="5" Height="40" Width="40" BorderThickness="1">
                    <Image Stretch="UniformToFill"
                           behavior:CommandHelper.MouseEnter="{Binding ShowUserInformationCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" 
                           behavior:CommandHelper.MouseEnterParameter="{Binding}" 
                           behavior:CommandHelper.MouseLeave="{Binding HideUserInformationCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}" 
                           Source="{Binding ProfileImageUrl, Converter={StaticResource ImageConverter}, IsAsync=True,Mode=OneTime}" />
                </Border>
            </Border>
            <!--Status Text-->
            <StackPanel Margin="10,0,0,0">
                <StackPanel Orientation="Horizontal">
                    <TextBlock TextWrapping="Wrap" Canvas.Top="0" Width="Auto">
                        <Hyperlink CommandParameter="{Binding ScreenName}"
                            Command="{Binding OpenUserPageCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
                                  <Run Text="{Binding ScreenName}"/></Hyperlink></TextBlock>
                    <controls:ImageEx Visibility="{Binding Verified, Converter={StaticResource BooleanToVisibilityConverter}}" Source="{StaticResource CertificateUser}" Height="18" Width="20"/>
                    <TextBlock Margin="10,0,0,0" Visibility="{Binding Following,Converter={StaticResource ContrastBooleanToVisibilityConverter}}">
                            <Hyperlink CommandParameter="{Binding Id}"
                            Command="{Binding MakeFriendCommand,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type Page}}}">
                            <Run Text="关注TA"/></Hyperlink>
                    </TextBlock>
                    <TextBlock Margin="10,0,0,0" Text="已关注" Visibility="{Binding Following,Converter={StaticResource BooleanToVisibilityConverter}}"/>
                </StackPanel>
                <StackPanel Margin="10,10,0,0">
                    <TextBlock Foreground="{DynamicResource StatusForegroundBrush}" LineHeight="20" Text="{Binding Location}" TextWrapping="Wrap"/>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="粉丝数："/>
                        <TextBlock LineHeight="20" Text="{Binding FollowersCount}"  Foreground="Red" TextWrapping="Wrap"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <TextBlock Text="微博数："/>
                        <TextBlock LineHeight="20" Text="{Binding StatusesCount}"  Foreground="Red" TextWrapping="Wrap"/>
                    </StackPanel>
                </StackPanel>
            </StackPanel>
        </DockPanel>
    </DataTemplate>
</ResourceDictionary>